<?php
@session_start();
include "../include/config.php";
include "../include/db.php";
require_once('../includes_php/FirePHPCore-0.3.2/lib/FirePHPCore/fb.php');

	//insertar en la DB 
    
    //echo $_POST['value'].' (server updated)';
    
/*
Array
(
    [value] => root
    [id] => admin_pass
    [row_id] => 1
    [campo_id] => admin_id
    [PHPSESSID] => cu1806eh0msnqpoohr14u8tqc3
)
*/    
    
// echo "<pre>";
// print_r($_REQUEST);
// echo "</pre>"

// die();

//mysql_real_escape_string ( string $unescaped_string [, resource $link_identifier ] )

    $campo      = $_REQUEST['campo_editar'];
    //$campo      = $_REQUEST['campoA'];
    $valor      = mysql_real_escape_string(utf8_decode($_REQUEST['value']));
    $id         = $_REQUEST['row_id'];
    $campo_id   = $_REQUEST['campo_id'];
    $tabla      = $_REQUEST['tabla'];
    
    $sql = "UPDATE $tabla SET $campo = '$valor' WHERE $campo_id = '$id' "; //die($sql);
    $result = mysql_query($sql)  or trigger_error(mysql_error());     
  
	fb($sql, 'query');
  
    echo $_REQUEST['value'];
?>